var myfunction = {

    Confirm: function(ConfirmList) {
        var textData = ''
        if (ConfirmList == 1) {
            textData = '图片'
        } else if (ConfirmList == 2) {
            textData = '视频'
        } else if (ConfirmList == 3) {
            textData = '文本'
        } else if (ConfirmList == 4) {
            textData = '流媒体'
        } else if (ConfirmList == 5) {
            textData = '字幕'
        } else if (ConfirmList == 6) {
            textData = '网页'
        } else if (ConfirmList == 7) {
            textData = '时间'
        } else if (ConfirmList == 8) {
            textData = '天气'
        } else if (ConfirmList == 9) {
            textData = '混合'
        }
        return textData
    },
    programSize: function(row) {
        var division = ''
        if (row) {
            if (row.programWidth > 4500) {
                division = 25;
            } else if (row.programWidth > 3500) {
                division = 15;
            } else if (row.programWidth > 1900) {
                division = 10;
            } else if (row.programWidth > 1600) {
                division = 8;
            } else if (row.programWidth > 1500) {
                division = 8;
            } else if (row.programWidth > 6000) {
                division = 28;
            } else if (row.programWidth > 800) {
                division = 8;
            } else {
                division = 5;
            }
        }
        return division
    },
    ifFunctionCode(...e) {
        var flag = "";
        e.forEach((element) => {
            if (!element) {
                flag = false;
            }
            if (element.indexOf("#") != -1) {
                let splist = [];
                splist = element.split("#");
                splist.forEach((ele2) => {
                    if (!flag) {
                        flag = this.forFunctionCode(ele2);
                    }
                });
            } else {
                flag = this.forFunctionCode(element);
            }
        });
        return flag;
    },
    forFunctionCode(e) {
        var flag = false;
        JSON.parse(sessionStorage.getItem("functionCode")).forEach((element) => {
            if (element.functionCode == e) {
                flag = true;
                return;
            }
        });
        return flag;
    },

}
export default myfunction